# Maintainer: Caleb Maclennan <caleb@alerque.com>

_pyname=crate
pkgname=python-$_pyname
pkgver=0.31.1
pkgrel=2
pkgdesc='A Python client library for CrateDB'
arch=(any)
url="https://github.com/crate/crate-python"
license=(Apache)
depends=(python
         python-urllib3)
makedepends=(python-{build,installer,wheel}
             python-setuptools)
optdepends=(python-sqlalchemy)
_archive="$_pyname-$pkgver"
source=("https://files.pythonhosted.org/packages/source/${_pyname::1}/$_pyname/$_archive.tar.gz")
sha256sums=('4988f3c8fa8a47a0690b9cf73ff0120d77b49b08bc1f3e35ddbf059bb71ce73a')

build() {
	cd "$_archive"
	python -m build -wn
}

package() {
	cd "$_archive"
	python -m installer -d "$pkgdir" dist/*.whl
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
	install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" {CONTRIBUTING,DEVELOP,README}.rst
}
